import React from "react";
import { Switch, Route ,Redirect} from "react-router-dom";

import ProductList from "page/product/index";
import ProductSave from "page/product/index/save";
import ProductDetail from "./index/detail";

class ProductRouter extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <Switch>
                <Route path="/product/index" component={ProductList} />
                <Route path="/product/save/:pid?" component={ProductSave} />
                <Route path="/product/detail/:pid" component={ProductDetail} />
                <Redirect exact from="/product" to="/product/index" />
            </Switch>
        );
    }
}
export default ProductRouter;